/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JPanelKFoldConfig.java
 *
 * Created on 14/09/2010, 01:10:20
 */

package moduledefault.partition.stratifiedkfold.view;

import moduledefault.partition.stratifiedkfold.FacadeStratifiedKFoldPartion;



/**
 *
 * @author evaristowb
 */
public class JPanelStratifiedKFoldConfig extends javax.swing.JPanel {

    /** Creates new form JPanelKFoldConfig */
    public JPanelStratifiedKFoldConfig() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelText = new javax.swing.JLabel();
        jTextFieldHoldout = new javax.swing.JTextField(Integer.toString(FacadeStratifiedKFoldPartion.getK()));
        jButtonCommit = new javax.swing.JButton();

        jLabelText.setFont(new java.awt.Font("Calibri", 0, 13)); // NOI18N
        jLabelText.setText("k-Partições");

        jButtonCommit.setFont(new java.awt.Font("Calibri", 0, 13));
        jButtonCommit.setText("Concluir");
        jButtonCommit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCommitActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButtonCommit)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelText)
                        .addGap(18, 18, 18)
                        .addComponent(jTextFieldHoldout, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelText)
                    .addComponent(jTextFieldHoldout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonCommit)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonCommitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCommitActionPerformed
        FacadeStratifiedKFoldPartion.setK(Integer.parseInt(jTextFieldHoldout.getText()));
        FacadeStratifiedKFoldPartion.getJDialogConfig().dispose();
    }//GEN-LAST:event_jButtonCommitActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonCommit;
    private javax.swing.JLabel jLabelText;
    private javax.swing.JTextField jTextFieldHoldout;
    // End of variables declaration//GEN-END:variables

}
